<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="utf-8"/>
    <title>用户个人中心</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}">
    <!--[if lt IE 9]>
    <script src="/js/html5.js"></script>
    <![endif]-->
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/jquery.mCustomScrollbar.concat.min.js}"></script>
    <script th:src="@{/js/jQuery-2.2.0.min.js}"></script>
</head>
<body>
<!--header-->
<header>
    <h1><img th:src="@{/images/1.jpg}"/></h1>
    <ul class="rt_nav">

        <li><a th:href="@{/page/user/index}" target="_blank" class="website_icon">返回首页</a></li>
        <li><a th:href="@{/page/user/loginOut}" class="quit_icon">安全退出</a></li>

    </ul>
</header>
<marquee th:text="${session.username}" style="font-size: 30px"></marquee>
<!--<form method="post" th:action="@{/upload/upload}" multiple="multiple" enctype="multipart/form-data">-->
    <section class="rt_wrap content mCustomScrollbar">
        <div class="rt_content">
            <div class="page_title">
                <h2 class="fl">用户实名认证</h2>
            </div>
            <ul class="ulColumn2">
                <li>
                    <span class="item_name" style="width:120px;">头像：</span>
                    <label class="uploadImg">
                        <input type="file" id="icon" name="file"/>
                        <span >头像</span>
                    </label>
                </li>
                <li>
                    <span class="item_name" style="width:120px;">姓名：</span>
                    <input type="email" class="textbox textbox_225" value="" placeholder="姓名..." id="name"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;">姓别：</span>
                    <input type="email" class="textbox textbox_225" value="" placeholder="姓别..." id="gender"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;">年龄：</span>
                    <input type="email" class="textbox textbox_225" value="" placeholder="年龄..." id="age"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;">电子邮箱：</span>
                    <input type="email" class="textbox textbox_225" value="" placeholder="电子邮件地址..." id="email"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;">手机号码：</span>
                    <input type="tel" class="textbox textbox_225" value="" placeholder="手机号码..." id="phone"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;" th:name="cardId">身份证号：</span>
                    <input type="text" class="textbox textbox_225" placeholder="身份证号..." id="idCard"/>
                    <span>    </span>
                </li>

                <li>
                    <span class="item_name" style="width:120px;">详细地址：</span>
                    <input type="text" class="textbox textbox_295" value="" placeholder="详细地址..." id="address"
                           name="address"/>
                    <span class="errorTips">错误提示信息...</span>
                </li>
                <li>
                    <span class="item_name" style="width:120px;"></span>
                    <input type="button" class="link_btn" value="提交" id="btn"/>
                </li>
            </ul>
        </div>
    </section>
<!--</form>-->
<script>
    $(function (){
        $("#btn").click(function (event){
            event.preventDefault()//取消事件的默认行为
            $.ajax({
                url:"/api/user/user_alter",
                type:"post",
                data:{
                    name:$("#name").val(),
                    gender:$("#gender").val(),
                    password:$("#password").val(),
                    age:$("#age").val(),
                    cardId:$("#idCard").val(),
                    address:$("#address").val()
                },
                success:function (result){
                    if (result.code==200){
                        alert("认证成功")
                        }else if(result.code==500){
                        alert("系统正在维护中请稍后再试...")
                    }else {
                        alert("用户认证失败")
                    }

                }
            })
            // $.ajax({
            //     url:"/upload/upload",
            //     type:"post",
            //     processData : false,
            //     contentType : false,
            //     async:false,
            //     data:{
            //        file:$("#icon").val()
            //     }
            // })

        })
    })
</script>
</body>
</html>
